package day07;


import java.util.ArrayList;


import java.util.Arrays;
import java.util.Iterator;
import java.util.Random;

public class test01 {
    public static void main(String[] args) {
        Random r = new Random();
        int[] arr = new int[10];
        ArrayList list = new ArrayList();
        for (int i = 0; i < arr.length; i++) {
            arr[i] = r.nextInt(100) + 1;
        }
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr.length - 1 - i; j++) {
                if (arr[j] > arr[j + 1]) {
                    int temp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = temp;
                }
            }
        }
        for (int i1 = 0; i1 < arr.length; i1++) {
            list.add(arr[i1]);
        }
        Iterator iterator = list.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }

    }
}


